<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
    <script src="/x/zjabank/static/js/echarts.js"></script>
    <script type="text/javascript" src="/x/zjabank/static/js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="/x/zjabank/static/widget/grid/map.js"></script>
    <script type="text/javascript" src="/x/zjabank/static/widget/grid/dlshouwen.grid.min.js"></script>
    <script type="text/javascript" src="/x/zjabank/static/widget/grid/i18n/zh-cn.js"></script>
    <!-- bootstrap -->
    <script type="text/javascript" src="/x/zjabank/static/widget/bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet" type="text/css" href="/x/zjabank/static/widget/bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="/x/zjabank/static/widget/grid/dlshouwen.grid.min.css"/>

    <!-- font-awesome -->
    <link rel="stylesheet" type="text/css" href="/x/zjabank/static/widget/fontAwesome/css/font-awesome.min.css" media="all"/>
	
</head>
<body>
    <div>
	<div id="echarts" style="width:850px;height:300px;margin:0px auto;"></div>
	<div id="gridContainer" class="dlshouwen-grid-container"></div>
    <div id="gridToolBarContainer" class="dlshouwen-grid-toolbar-container"></div>
    </div>
	<script type="text/javascript">
		var myChart = echarts.init(document.getElementById('echarts'));
		var xcontent= new Array();
		var data1 = new Array();
	    var data2 = new Array();
	    var data3 = new Array();
	    var map1 = getMap();
	    var map2 = getMap();
	    jQuery.ajax({  
	    	url:'/x/zjabank/rst/resend?controller=charts@zhuzhuangshuju',
	    	type:'get',  
	    	dataType:'json', 
	    	cache:false,
	    	success:function(jsons){
	    		var a = []; 
	    		$.each(jsons, function(key, val) { a[a.length] = key;  });  
	    		a.sort();  
	    		$.each(a, function(i, key) {  
	    		 xcontent.push(key);
	    		 var a = new Array();
	         	 var a = jsons[key];
	         	data1.push(a[0]);
	         	data2.push(a[1]);
	         	data3.push(a[2]);
	         	map1.put(key,a[4]);
	         	map2.put(key,a[5]);
	         	
	    		}); 
		var option = {
    tooltip : {
        trigger: 'axis',
        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
        },
        formatter: function (params, ticket,  callback) {
        	var res = params[0].name + '<br/>'; 
        	res=res+'已发布:数量:'+ params[0].value +';总金额：'+map1.get(params[0].name)+ '(万元)<br/>';
        	res=res+'已撤销:数量:'+ params[1].value +';总金额：'+map2.get(params[0].name)+ '(万元)<br/>'; 
            return res; 
       }
    },
    legend: {
        data:['已发布数','已撤销数']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    xAxis : [
        {
            type : 'category',
            data : xcontent//['杭州市','宁波市','温州市','绍兴市','金华市','丽水市','其他']
        }
    ],
    yAxis : [
        {
            type : 'value'
        }
    ],
    series : [
        {
            name:'已发布数',
            type:'bar',
            data:data3//[320, 332, 301, 334, 390, 330, 320]
        },
        {
            name:'已撤销数',
            type:'bar',
            stack: '广告',
            data:data2//[120, 132, 101, 134, 90, 230, 210]
        }
    ]
};
		myChart.setOption(option);
		
	    	},
	        error:function(){  
	        	 alert("数据加载失败！请检查数据链接是否正确");  
	        }  
	    });
	    
//liebiao
//列表
    var area = {330000:'浙江省',330100:'杭州市',330102:'上城区',330103:'下城区',330104:'江干区',330105:'拱墅区',330106:'西湖区',330108:'滨江区',330109:'萧山区',330110:'余杭区',330122:'桐庐县',330127:'淳安县',330182:'建德市',330183:'富阳区',330185:'临安市',330200:'宁波市',330203:'海曙区',330204:'江东区',330205:'江北区',330206:'北仑区',330211:'镇海区',330212:'鄞州区',330225:'象山县',330226:'宁海县',330281:'余姚市',330282:'慈溪市',330283:'奉化市',330300:'温州市',330302:'鹿城区',330303:'龙湾区',330304:'瓯海区',330322:'洞头区',330324:'永嘉县',330326:'平阳县',330327:'苍南县',330328:'文成县',330329:'泰顺县',330381:'瑞安市',330382:'乐清市',330400:'嘉兴市',330402:'南湖区',330411:'秀洲区',330421:'嘉善县',330424:'海盐县',330481:'海宁市',330482:'平湖市',330483:'桐乡市',330500:'湖州市',330502:'吴兴区',330503:'南浔区',330521:'德清县',330522:'长兴县',330523:'安吉县',330600:'绍兴市',330602:'越城区',330621:'绍兴县',330624:'新昌县',330681:'诸暨市',330682:'上虞市',330683:'嵊州市',330700:'金华市',330702:'婺城区',330703:'金东区',330723:'武义县',330726:'浦江县',330727:'磐安县',330781:'兰溪市',330782:'义乌市',330783:'东阳市',330784:'永康市',330800:'衢州市',330802:'柯城区',330821:'衢江区',330822:'常山县',330824:'开化县',330825:'龙游县',330881:'江山市',330900:'舟山市',330902:'定海区',330903:'普陀区',330921:'岱山县',330922:'嵊泗县',331000:'台州市',331002:'椒江区',331003:'黄岩区',331004:'路桥区',331021:'玉环县',331022:'三门县',331023:'天台县',331024:'仙居县',331081:'温岭市',331082:'临海市',331100:'丽水市',331102:'莲都区',331121:'青田县',331122:'缙云县',331123:'遂昌县',331124:'松阳县',331125:'云和县',331126:'庆元县',331127:'景宁畲族自治县',331181:'龙泉市'};
    var gridColumns = [{
        id: 'area_code',
        title: '地区',
        type: 'string',
        codeTable: area,
        columnClass: 'text-center',
        hideType: 'sm|xs',
        fastQuery: true,
        fastQueryType: 'eq'
    }, {
        id: 'yicexiao',
        title: '已撤销数量',
        type: 'number',
        format: '#,###',
        columnClass: 'text-center',
        hideType: 'xs',
        fastQuery: true,
        fastQueryType: 'eq'
    }, {
        id: 'yicexiaoSum',
        title: '已撤销总金额(万元)',
        type: 'number',
        format: '#,###.00',
        columnClass: 'text-center',
        hideType: 'xs',
        fastQuery: true,
        fastQueryType: 'eq'
    },{
        id: 'yifabu',
        title: '发布数量',
        type: 'number',
        format: '#,###',
        columnClass: 'text-center',
        hideType: 'xs',
        fastQuery: true,
        fastQueryType: 'eq'
    },{
        id: 'yifabuSum',
        title: '已发布总金额',
        type: 'number',
        format: '#,###.00',
        columnClass: 'text-center',
        hideType: 'xs',
        fastQuery: true,
        fastQueryType: 'eq'
    }];
    var gridOption = {
        lang: 'zh-cn',
        ajaxLoad: true,
        loadURL: '/x/zjabank/rst/resend?controller=charts@zhuzhuanglb',
        exportFileName: '用户列表',
        columns: gridColumns,
        gridContainer: 'gridContainer',
        toolbarContainer: 'gridToolBarContainer',
        tools: '',
        pageSize: 10,
        pageSizeLimit: [10, 20, 50]
    };
    var grid = $.fn.dlshouwen.grid.init(gridOption);
    $(function () {
        grid.load();
    });
	</script>
</body>
</html>